
/* iq fixed point math routines appended to the end of this file ! */


/*
 * MKT:@(#) B1462-11000 A.03.51 68332  C CROSS COMPILER                  24Oct91                      
 * @(SUBID):$Source: /vsrc/vireo/include/RCS/math.h,v $ $Revision: 2.2 $
 */

#ifndef _MATH_INCLUDED_

#define _MATH_INCLUDED_	1

/*
 * Alias the external names so that users of the compiler front-end
 * can use the -l option of ccom and still use the shipped libraries.
 */
#pragma ALIAS	frexp		_frexp
#pragma ALIAS	ldexp		_ldexp
#pragma ALIAS	modf		_modf
#pragma ALIAS	ceil		_ceil
#pragma ALIAS	floor		_floor
#pragma ALIAS	_infinity	__infinity
#pragma ALIAS	pow		_pow
#pragma ALIAS	fmod		_fmod
#pragma ALIAS	frem		_frem
#pragma ALIAS	atan2		_atan2
#pragma ALIAS	acos		_acos
#pragma ALIAS	asin		_asin
#pragma ALIAS	atan		_atan
#pragma ALIAS	cos		_cos
#pragma ALIAS	sin		_sin
#pragma ALIAS	tan		_tan
#pragma ALIAS	cosh		_cosh
#pragma ALIAS	sinh		_sinh
#pragma ALIAS	tanh		_tanh
#pragma ALIAS	exp		_exp
#pragma ALIAS	log		_log
#pragma ALIAS	log10		_log10
#pragma ALIAS	sqrt		_sqrt
#pragma ALIAS	fabs		_fabs

#pragma SECTION PROG=libm
extern double	acos(double x),
		asin(double x),
		atan(double x),
		atan2(double y, double x),
		cos(double x),
		sin(double x),
		tan(double x),
		cosh(double x),
		sinh(double x),
		tanh(double x),
		exp(double x),
		frexp(double value, int *exp),
		ldexp(double x, int exp),
		log(double x),
		log10(double x),
		modf(double value, double *iptr),
		pow(double x, double y),
		sqrt(double x),
		ceil(double x),
		fabs(double x),
		floor(double x),
		fmod(double x, double y),
		frem(double x, double y);
#pragma SECTION UNDO

#pragma SECTION	CONST=libc
extern const unsigned long int	_infinity[];
#pragma SECTION UNDO

#define HUGE_VAL	(* ((double *) _infinity))
#endif	/* _MATH_INCLUDED_ */

U_INT16 SqrtLU ( U_INT32 num_sqrd );

U_INT16 PointSevenPower ( U_INT16 number );

U_INT32 QuadWordMultiplyDivide ( U_INT32 multiplicand, 
                                    U_INT32 multiplier,
                                    U_INT32 divisor );

INT32 SignedQuadWordMultiplyDivide ( INT32 multiplicand, 
                                     U_INT32 multiplier,
                                     U_INT32 divisor );


U_INT32 BoundsCheckedQWMD      ( U_INT32 multiplicand,
                                 U_INT32 multiplier,
                                 U_INT32 divisor,
                                 U_INT32 limit,
                                 BIT8    *overflow );

